/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License Version
 *  3 as published by the Free Software Foundation.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Lesser General Public License for more details.
 *
 *  You should have received a copy of the GNU Lesser General Public
 *  License along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
 *  USA.
 */

#ifndef TASKSMANAGER_H
#define TASKSMANAGER_H

#include <optra/common/sdk.h>
#include <QObject>
#include <optra/common/logevent.h>
#include <QMap>

class Task;
class Application;
class TasksManager : public QObject
{
Q_OBJECT
public:
    TasksManager(Application* app, QObject *parent = 0);
    ~TasksManager();
    void startApplication(const QString& name);
    void startTask(Task* task);
signals:

public slots:
    void taskStarted();
    void taskTermintated();
    void taskfinished();

    void taskState(const QString& message, Optra::LogEvent::LogType  type);
private:
    QMap<QString, Task*> tasks_;
    Application* app_;
};

#endif // TASKSMANAGER_H
